package com.song.tools.songtest.convertor;

import com.song.tools.mvc.convertor.AggregationConvertor;
import com.song.tools.songtest.beans.bo.SysRoleUserBo;
import com.song.tools.songtest.beans.poi.SysRoleUserExportDto;
import com.song.tools.songtest.beans.poi.SysRoleUserImportDto;
import com.song.tools.songtest.beans.query.SysRoleUserQuery;
import com.song.tools.songtest.beans.request.SysRoleUserQueryRequest;
import com.song.tools.songtest.beans.request.SysRoleUserSaveRequest;
import com.song.tools.songtest.beans.request.SysRoleUserUpdateRequest;
import com.song.tools.songtest.beans.response.SysRoleUserQueryResponse;
import com.song.tools.songtest.beans.response.SysRoleUserSaveResponse;
import com.song.tools.songtest.beans.response.SysRoleUserUpdateResponse;
import com.song.tools.songtest.dao.entity.SysRoleUser;
import org.mapstruct.AfterMapping;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;

import java.util.List;

/**
 * <p>
 * 用户角色关系表 转换器
 * </p>
 *
 * @author song tools
 * @since 2024-07-12
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public abstract class SysRoleUserConvertor implements AggregationConvertor<SysRoleUser, SysRoleUserBo, SysRoleUserQuery, SysRoleUserQueryRequest, SysRoleUserQueryResponse,
        SysRoleUserSaveRequest, SysRoleUserSaveResponse, SysRoleUserUpdateRequest, SysRoleUserUpdateResponse, SysRoleUserImportDto, SysRoleUserExportDto> {

    @Override
    public abstract SysRoleUser entityBoToEntity(SysRoleUserBo sysRoleUserBo);

    @Override
    public abstract SysRoleUserBo entityToEntityBo(SysRoleUser sysRoleUser);

    @Override
    public abstract SysRoleUserQueryResponse entityBoToQueryResponse(SysRoleUserBo sysRoleUserBo);

    @Override
    public abstract SysRoleUserQuery queryRequestToQuery(SysRoleUserQueryRequest queryRequest);

    @Override
    public abstract SysRoleUserBo saveRequestToEntityBo(SysRoleUserSaveRequest request);

    @Override
    public abstract SysRoleUserSaveResponse entityBoToSaveResponse(SysRoleUserBo sysRoleUserBo);

    @Override
    public abstract SysRoleUserBo updateRequestToEntityBo(SysRoleUserUpdateRequest request);

    @Override
    public abstract SysRoleUserUpdateResponse entityBoToUpdateResponse(SysRoleUserBo sysRoleUserBo);

    @Override
    public abstract List<SysRoleUser> entityBoToEntity(List<SysRoleUserBo> entityBo);

    @Override
    public abstract List<SysRoleUserBo> entityToEntityBo(List<SysRoleUser> entity);

    @Override
    public abstract SysRoleUserExportDto entityBoToExportDto(SysRoleUserBo entityBo);

    @Override
    public abstract SysRoleUserBo importDtoToEntityBo(SysRoleUserImportDto importDto);

    @Override
    public abstract List<SysRoleUserBo> importDtoToEntityBo(List<SysRoleUserImportDto> importDto);


    @AfterMapping
    public void afterMappingEntityBoToEntity(@MappingTarget SysRoleUser sysRoleUser, SysRoleUserBo sysRoleUserBo) {
        // entityBoToEntity() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToEntity()
    }

    @AfterMapping
    public void afterMappingEntityToEntityBo(@MappingTarget SysRoleUserBo sysRoleUserBo, SysRoleUser sysRoleUser) {
        // entityToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityToEntityBo()
    }

    @AfterMapping
    public void afterMappingQueryRequestToQuery(@MappingTarget SysRoleUserQuery sysRoleUserQuery, SysRoleUserQueryRequest sysRoleUserQueryRequest) {
        // queryRequestToQuery() 内部其它代码执行完之后，最后会自动执行 afterMappingQueryRequestToQuery()
    }

    @AfterMapping
    public void afterMappingEntityBoToQueryResponse(@MappingTarget SysRoleUserQueryResponse sysRoleUserQueryResponse, SysRoleUserBo sysRoleUserBo) {
        // entityBoToQueryResponse() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToQueryResponse()
    }

    @AfterMapping
    public void afterMappingEntityBoToSaveResponse(@MappingTarget SysRoleUserSaveResponse sysRoleUserSaveResponse, SysRoleUserBo sysRoleUserBo) {
        // entityBoToSaveResponse() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToSaveResponse()
    }

    @AfterMapping
    public void afterMappingSaveRequestToEntityBo(@MappingTarget SysRoleUserBo sysRoleUserBo, SysRoleUserSaveRequest sysRoleUserSaveRequest) {
        // saveRequestToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingSaveRequestToEntityBo()
    }

    @AfterMapping
    public void afterMappingEntityBoToUpdateResponse(@MappingTarget SysRoleUserUpdateResponse sysRoleUserUpdateResponse, SysRoleUserBo sysRoleUserBo) {
        // entityBoToUpdateResponse() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToUpdateResponse()
    }

    @AfterMapping
    public void afterMappingUpdateRequestToEntityBo(@MappingTarget SysRoleUserBo sysRoleUserBo, SysRoleUserUpdateRequest sysRoleUserUpdateRequest) {
        // updateRequestToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingUpdateRequestToEntityBo()
    }

    @AfterMapping
    public void afterMappingImportDtoToEntityBo(@MappingTarget SysRoleUserBo sysRoleUserBo, SysRoleUserImportDto sysRoleUserImportDto) {
        // importDtoToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingImportDtoToEntityBo()
    }

    @AfterMapping
    public void afterMappingEntityBoToExportDto(@MappingTarget SysRoleUserExportDto sysRoleUserExportDto, SysRoleUserBo sysRoleUserBo) {
        // entityBoToExportDto() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToExportDto()
    }
}
